﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Content.Master" 
	Inherits="System.Web.Mvc.ViewPage<cludg.Web.ViewModels.OfferApprovingModel>" %>
<%@ Import Namespace="cludg.Web.RenderHelpers" %>

<asp:Content ID="Content0" ContentPlaceHolderID="HeadContent" runat="server">
	<link rel="stylesheet" href="../../Content/redactor/css/redactor.css" type="text/css" media="all"/>
	<script type="text/javascript" src="../../Scripts/redactor.js"></script>	

	<script type="text/javascript">
		$(document).ready(
			function () {
				new Redactor('Body', { focus: true });
			}
		);
	</script>

</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Утвердить историю
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
	<h2>Утвердить историю</h2>
	<% Html.EnableClientValidation(); %>
	<% using (Html.BeginForm())
	{%>
	<%: Html.ValidationSummary(true) %>
	<fieldset>

		<div>
			<% Html.StorySubject(Model.Offer.Subject); %>
		</div>

		<div>
			<div class="editor-label">
				<%: Html.LabelFor(model => model.Title) %>
			</div>
			<div class="editor-field">
				<%: Html.TextBoxFor(model => model.Title, new { style = "width: 100%;" })%>
				<%: Html.ValidationMessageFor(model => model.Title) %>
			</div>

			<div class="editor-label">
				<%: Html.LabelFor(model => model.Body) %>
			</div>
			<div class="editor-field">
				<%: Html.TextAreaFor(model => model.Body, new { style = "width: 100%; height: 320px;" })%>
				<%: Html.ValidationMessageFor(model => model.Body) %>
			</div>

			<div class="editor-label">
				<%: Html.LabelFor(model => model.Tags) %>
			</div>
			<div class="editor-field">
				<%: Html.TextBoxFor(model => model.Tags, new { style = "width: 100%;" })%>
				<%: Html.ValidationMessageFor(model => model.Tags)%>
			</div>

			<% if (Model.Offer.Author == null)
			 { %>
				<div class="editor-label">
					<%: Html.LabelFor(model => model.AnonymouseAuthorName)%>
				</div>
				<div class="editor-field">
					<%: Html.TextBoxFor(model => model.AnonymouseAuthorName)%>
					<%: Html.ValidationMessageFor(model => model.AnonymouseAuthorName)%>
				</div>
			<% } else { %>
				Предложил: <%: Model.Offer.Author.DisplayName %>
			<% } %>
			<%: Html.Hidden("OfferId", Model.Offer.Id) %>

			<div style = "text-align: right; ">
				<input type="submit" value="добавить"/>
			</div>
		</div>
	</fieldset>
	<% } %>
</asp:Content>
